package com.jing.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jing.domain.User;
import com.jing.mapper.UserMapper;
import com.jing.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Resource
	UserMapper userMapper;
	
	@Override
	public String sayHello(String name) {
		System.out.println("Hello" + name);
		return "Hello" + name;
	}

	@Override
	public List<User> findAll() {
		return userMapper.select(null);
	}

	@Override
	public User get(Integer userId) {
		return userMapper.get(userId);
	}

	@Override
	public Integer add(User user) {
		return userMapper.insert(user);
	}

	@Override
	public Integer delete(User user) {
		return userMapper.delete(user.getId());
	}

	@Override
	public Integer update(User user) {
		return userMapper.update(user);
	}

}
